package com.yuandengta.yomall.ware.controller;

import com.yuandengta.common.utils.R;
import com.yuandengta.yomall.ware.service.FareService;
import com.yuandengta.yomall.ware.vo.FareVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 物流运费 {@link FareController}
 *
 * @author Kevin
 * @email: 178676392@qq.com
 */
@RestController
public class FareController {

    @Autowired
    private FareService fareService;

    /**
     * 获取物流运费
     * @param addrId
     * @return
     */
    @GetMapping("/ware/fare")
    public R getFare(@RequestParam("addrId") Long addrId){
        FareVO fareVO = fareService.getFare(addrId);
        return R.ok().put("data", fareVO);
    }
}
